package enumerated;

enum Shrubbery {GROUP,CRAWING,HANGING}
public class EnumClass {
    public static void main(String[] args){
        for (Shrubbery s : Shrubbery.values()){
            System.out.println(s+" ordinal: "+s.ordinal());
            System.out.print(s.compareTo(Shrubbery.CRAWING) + " ");
            System.out.print(s.equals(Shrubbery.CRAWING) + " ");
            System.out.println(s == Shrubbery.CRAWING);
            System.out.println(s.getDeclaringClass());
            System.out.println(s.name());
            System.out.println("--------------------------------");
        }

        for (String s : "HANGING GROUP CRAWING".split(" ")){
            Shrubbery shrub = Enum.valueOf(Shrubbery.class,s);
            System.out.println(shrub);
            System.out.println(shrub.ordinal());
        }
    }
}
